<%@page import="webone.javabean.OnlineUserInfo"%>
<%@page import="java.util.Map"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@taglib prefix="c"  uri="http://java.sun.com/jsp/jstl/core"%>
    <%@page import="java.util.Set"%>
    <%@page import="webone.context.MyUserInfoContext"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
	<%
		MyUserInfoContext myc = MyUserInfoContext.getInstance();
		Map<String,OnlineUserInfo> onlineUserInfoMap=myc.getOnlineUserInfoMap();	
	%>
	<table align="center" cellspacing="0" cellpadding="10">
	<caption>网站用户登录统计</caption>
	<tr>
		<th>在线用户</th>
		<th>最近登录时间</th>
		<th>操作</th>
	</tr>
	<tr>
		<td>网站在线人数</td>
		<td colspan="2"><%=onlineUserInfoMap.size()%>人</td>
	</tr>
	<c:forEach items="${onlineUserInfoMap}" var="users">
		<tr>
		<c:if test="${users.value.username}!=null">
			<td>${users.value.username}</td>
		</c:if>
		<c:if test="${users.value.username}==null">
			<td>${users.value.ip}</td>
		</c:if>
		<td>${users.value.recenttime}</td>
		<td><a href="kickedOutServlet?sessionid=${users.value.sessionid}">踢出</a></td>
		</tr>
	</c:forEach>	
	</table>
</body>
</html>